package com.dks.controller.publicCompoment;


import com.dks.dto.BaseIdRequestDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import com.dks.dto.publicCompoment.PublicCommentReplyDto;
import com.dks.models.publicCompoment.PublicCommentReply;
import com.dks.repository.IPublicCommentReplyRepository;
import com.dks.result.ResultModel;

/**
 * 公共-评论的回复
 */
@RestController
@RequestMapping("comment/reply")
public class PublicCommentReplyController{

    @Autowired
    private IPublicCommentReplyRepository publicCommentReplyRepository;

    /**
     * 新增评论回复
     * @author evan
     */
    @PostMapping("add")
    public ResultModel<PublicCommentReply> add(@RequestBody @Validated PublicCommentReplyDto publicCommentReplyDto) {
        return publicCommentReplyRepository.add(publicCommentReplyDto);
    }

    /**
     * 删除评论回复
     * @author evan
     */
    @PostMapping("remove")
    public ResultModel<PublicCommentReply> delete(@RequestBody @Validated BaseIdRequestDto baseIdRequestDto) {
        return publicCommentReplyRepository.delete(baseIdRequestDto);
    }

}
